import { defineStore } from 'pinia'

export const useAuthStore = defineStore('auth', {
  state: () => ({
    authDialog: false,
    loginDialog: true,
    registerDialog: false
  }),

  actions: {
    setAuthDialog(value) {
      this.authDialog = value === true
    },
    
    setLoginDialog(value) {
      this.loginDialog = value === true
    },
    
    setRegisterDialog(value) {
      this.registerDialog = value === true
    },
    
    clearDialog() {
      this.authDialog = false
      this.loginDialog = true
      this.registerDialog = false
    },

    openLoginDialog() {
      this.authDialog = true
      this.loginDialog = true
      this.registerDialog = false
    }
  },

  getters: {
    getAuthDialog: (state) => state.authDialog,
    getLoginDialog: (state) => state.loginDialog,
    getRegisterDialog: (state) => state.registerDialog
  }
}) 